<template>
  <view class="setting-page" :style="my_style">
    <view class="cell-list u-m-t-20">
      <view
        class="u-p-l-30 bg-white"
        v-for="(item, index) in list"
        :key="index"
        @click="jump(item.link)"
      >
        <view class="flex-between u-flex-1 u-font-32 u-border-bottom u-p-b-22 u-p-t-22 u-p-r-30">
          <text>{{ item.title }}</text>
          <view class="flex-row">
            <text class="u-m-r-12 light-color">{{ item.value }}</text>
            <u-icon name="arrow-right" color="#CCCCCC" size="30"></u-icon>
          </view>
        </view>
      </view>
    </view>
    <!-- 退出登录 -->
    <!-- #ifdef APP-PLUS||H5 -->
    <view @tap="logout" class="footer white-color flex-center">退出登录</view>
    <!-- #endif -->
  </view>
</template>

<script>
  export default {
    data() {
      return {
        list: [
          // {
          //   title: '修改支付密码',
          //   link: '/views/user/setting/mobile?type=reset_pwd&scene=verify_mobile',
          // },
          // {
          //   title: '换绑手机号',
          //   link: '/views/user/setting/mobile?type=change_bind&scene=verify_mobile',
          //   value: '',
          // },
          // {
          //   title: '注销账号',
          //   link: '/views/user/setting/mobile?type=destory_account&scene=destory_account',
          //   space: true,
          // },
          {
            title: '关于我们',
            link: '/views/about/index',
          },
          {
            title: '意见反馈',
            link: '/views/user/setting/feedback',
          },
          {
            title: '帮助中心',
            link: '/views/user/setting/help',
          },
        ],
      }
    },
    onLoad(options) {},
    methods: {
      /**
       * 退出登录
       */
      async logout() {
        const res = await this.$api.common.user('logout')
        if (res.code === 200) {
          uni.removeStorageSync('access_token')
          uni.removeStorageSync('member_id')
          this.successBack('退出登录成功', 1)
        }
      },
    },
  }
</script>
<style lang="scss" scoped>
  .setting-page {
    .footer {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 96rpx;
      background: #ff5252;
    }
  }
</style>
